<template>
  <div :class="Toggle == '1' ? 'age-body' : 'age-Editor'">
    <div class="person-body" v-if="Toggle == '1'">
      <div class="append">
        <i class="el-icon-edit-outline" @click="handelClick"></i
        ><span @click="handelClick">编辑</span>
      </div>
      <div class="content">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
    </div>
    <div class="Editor-body" v-if="Toggle == '2'">
      <p class="title">自我评价 <i class="el-icon-delete"></i></p>
      <div class="body">
        <el-input
          type="textarea"
          :rows="2"
          placeholder="请输入内容"
          v-model="textarea"
        >
        </el-input>
      </div>
      <div class="bottom">
        <p @click="handelOff(2)">取消</p>
        <p @click="handelOff(1)">确认</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      Toggle: "1",

      textarea: ''
    };
  },
  components: {},
  methods: {
    handelClick() {
      this.Toggle = "2";
    },
    // 编辑 性别切换
    handelEle(num) {
      this.ele = num;
    },
    // 切换身份
    handelSelect(num) {
      this.select = num;
    },
    // 取消/确认
    handelOff(num) {
      if (num == 1) {
        this.Toggle = "1";
      } else {
        this.Toggle = "1";
      }
    },
  },
};
</script>

<style scoped lang="less">
.age-body {
  width: 100%;
  height: 100%;
  display: flex;
  .person-body {
    width: 100%;
    margin: 0 auto;
    margin-top: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    // 添加
    .append {
      width: 100%;
      height: 20px;
      line-height: 20px;
      display: flex;
      justify-content: flex-end;
      vertical-align: middle;
      i {
        font-size: 20px;
        vertical-align: middle;
      }
    }
    // 内容
    .content {
      width: 100%;
    }
  }
}
/deep/.el-input__inner {
  height: 30px !important;
  font-size: 14px;
}
// 编辑
.age-Editor {
  width: 100%;
  height: 100%;
  display: flex;
  background-color: #f8f8f8;
  .Editor-body {
    width: 94%;
    margin: 0 auto;
    margin-top: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    .title {
      height: 30px;
      line-height: 30px;
      font-size: 15px;
      font-weight: 600;
      position: relative;
      i {
        position: absolute;
        font-size: 20px;
        right: 0;
      }
    }
    .body {
      width: 100%;
      display: flex;
      margin-top: 20px;
      position: relative;
    }
    .bottom {
      width: 100%;
      height: 35px;
      display: flex;
      margin-top: 10px;
      justify-content: flex-end;
      p {
        width: 80px;
        height: 35px;
        background-color: #3894ff;
        border-radius: 5px;
        line-height: 35px;
        text-align: center;
        color: #ffffff;
      }
      p:nth-child(1) {
        background-color: #919191;
        margin-right: 20px;
      }
    }
  }
}
</style>
